﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using HsTec.DigitalPlatform.Model.DTO;
using HsTec.DigitalPlatform.Business;

namespace HsTec.DigitalPlatform.WebSite.Controllers
{
    public class LoginController : Controller
    {
        UserInfoManager userinformanager = new UserInfoManager();
        //
        // GET: /Login/
        public ActionResult Index()
        {
            return View();
        }
        [HttpPost]
        public ActionResult Index(LoginModel item)
        {
            if (userinformanager.CheckUserInfo(item.UserName, item.Password))
            {
                return RedirectToAction("Index", "Main");
            }
            else
            {
                ModelState.AddModelError("", "用户名密码错误！");
            }
            return View();
        }
    }
}
